package com.bolt.auth.admin.api.sys.dto;

import com.bolt.auth.admin.api.sys.entity.DataScopeEnum;
import com.bolt.convention.data.BaseDTO;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

@Data
@JsonIgnoreProperties(value = { "hibernateLazyInitializer"})
public class RoleDTO extends BaseDTO {

    private String id;

    /**
     * * 角色代码
     **/
    @ApiModelProperty(notes = "角色代码")
    @NotBlank
    @Pattern(regexp = "^ROLE_.*", message = "必须以[ROLE_]开头")
    private String code;

    /**
     * * 角色名称
     **/
    @ApiModelProperty(notes = "角色名称")
    @NotBlank
    private String name;

    /**
     * * 说明
     **/
    @ApiModelProperty(notes = "说明")
    private String description;

    /**
     * * 是否禁用
     **/
    @ApiModelProperty(notes = "是否禁用")
    @NotNull
    private Boolean enabled;

    private Integer versionNO;

    private Boolean related;

    @ApiModelProperty(value = "机构", hidden = true)
    private List<OrgDTO> orgs;

    @ApiModelProperty(value = "数据权限，全部 、 本级 、 自定义")
    private DataScopeEnum dataScope ;

}